package pl.un4giv3n.mightvsmagic.entity;

import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;

@NamedQueries( {
		@NamedQuery(name = "find.all.skilltemplates", query = "select t from SpecialSkillTemplate t"),
		@NamedQuery(name = "find.template.for.user", query = "select t from SpecialSkillTemplate t "
				+ "where t.strenghtReq <= :strenghtParam "
				+ "and t.staminaReq <= :staminaParam "
				+ "and t.manaReq <= :manaParam "
				+ "and t.attackReq <= :attackParam "
				+ "and t.parryReq <= :parryParam "
				+ "and t.requiredFightExp <= :requiredFightExpParam "
				+ "and t.requiredMagicExp <= :requiredMagicExpParam ")
})
@Entity
public class SpecialSkillTemplate {

	private Long id;
	private String name;
	private double dmgFactor;
	private double defFactor;
	private double speedFactor;
	private int minDmgIncrease;
	private int maxDmgIncrease;
	private int minDefIncrease;
	private int maxDefIncrease;
	private int iceDamage;
	private int fireDamage;
	private int earthDamage;
	private int windDamage;
	private int iceDefence;
	private int fireDefence;
	private int earthDefence;
	private int windDefence;
	/**
	 * item modificatiors
	 */
	private long strenghtModifier;
	private long staminaModifier;
	private long manaModifier;
	private long attackModifier;
	private long parryModifier;
	private long speedModifier;

	/**
	 * item requirements
	 */
	private long strenghtReq;
	private long staminaReq;
	private long manaReq;
	private long attackReq;
	private long parryReq;
	private long requiredFightExp;
	private long requiredMagicExp;

	private long price;
	private int premiumPrice;
	
	private long[] requiresToLearn;
	private long[] blocksLearning;

	public SpecialSkillTemplate() {
	}

	public SpecialSkillTemplate(String name, double dmgFactor,
			double defFactor, double speedFactor, int minDmgIncrease, int maxDmgIncrease,
			int minDefIncrease, int maxDefIncrease, long strenghtModifier,
			long staminaModifier, long manaModifier, long attackModifier,
			long parryModifier, long speedModifier, long strenghtReq, long staminaReq,
			long manaReq, long attackReq, long parryReq, long requiredFightExp,
			long requiredMagicExp, long price, int premiumPrice, int iceDamage, int fireDamage,
			int earthDamage, int windDamage, int iceDefence, int fireDefence,
			int earthDefence, int windDefence, long[] requiresToLearn, long[] blocksLearning) {
		super();
		this.name = name;
		this.dmgFactor = dmgFactor;
		this.defFactor = defFactor;
		this.speedFactor = speedFactor;
		this.minDmgIncrease = minDmgIncrease;
		this.maxDmgIncrease = maxDmgIncrease;
		this.minDefIncrease = minDefIncrease;
		this.maxDefIncrease = maxDefIncrease;
		this.strenghtModifier = strenghtModifier;
		this.staminaModifier = staminaModifier;
		this.manaModifier = manaModifier;
		this.attackModifier = attackModifier;
		this.parryModifier = parryModifier;
		this.speedModifier = speedModifier;
		this.strenghtReq = strenghtReq;
		this.staminaReq = staminaReq;
		this.manaReq = manaReq;
		this.attackReq = attackReq;
		this.parryReq = parryReq;
		this.requiredFightExp = requiredFightExp;
		this.requiredMagicExp = requiredMagicExp;
		this.iceDamage = iceDamage;
		this.fireDamage = fireDamage;
		this.earthDamage = earthDamage;
		this.windDamage = windDamage;
		this.iceDefence = iceDefence;
		this.fireDefence = fireDefence;
		this.earthDefence = earthDefence;
		this.windDefence = windDefence;
		this.price = price;
		this.premiumPrice = premiumPrice;
		this.requiresToLearn = requiresToLearn;
		this.blocksLearning = blocksLearning;
	}

	@Id
	@GeneratedValue
	public Long getId() {
		return id;
	}

	public void setId(Long id) {
		this.id = id;
	}

	public double getDmgFactor() {
		return dmgFactor;
	}

	public void setDmgFactor(double dmgFactor) {
		this.dmgFactor = dmgFactor;
	}

	public double getDefFactor() {
		return defFactor;
	}

	public void setDefFactor(double defFactor) {
		this.defFactor = defFactor;
	}

	public int getMinDmgIncrease() {
		return minDmgIncrease;
	}

	public void setMinDmgIncrease(int minDmgIncrease) {
		this.minDmgIncrease = minDmgIncrease;
	}

	public int getMaxDmgIncrease() {
		return maxDmgIncrease;
	}

	public void setMaxDmgIncrease(int maxDmgIncrease) {
		this.maxDmgIncrease = maxDmgIncrease;
	}

	public int getMinDefIncrease() {
		return minDefIncrease;
	}

	public void setMinDefIncrease(int minDefIncrease) {
		this.minDefIncrease = minDefIncrease;
	}

	public int getMaxDefIncrease() {
		return maxDefIncrease;
	}

	public void setMaxDefIncrease(int maxDefIncrease) {
		this.maxDefIncrease = maxDefIncrease;
	}

	public long getStrenghtModifier() {
		return strenghtModifier;
	}

	public void setStrenghtModifier(long strenghtModifier) {
		this.strenghtModifier = strenghtModifier;
	}

	public long getStaminaModifier() {
		return staminaModifier;
	}

	public void setStaminaModifier(long staminaModifier) {
		this.staminaModifier = staminaModifier;
	}

	public long getManaModifier() {
		return manaModifier;
	}

	public void setManaModifier(long manaModifier) {
		this.manaModifier = manaModifier;
	}

	public long getAttackModifier() {
		return attackModifier;
	}

	public void setAttackModifier(long attackModifier) {
		this.attackModifier = attackModifier;
	}

	public long getParryModifier() {
		return parryModifier;
	}

	public void setParryModifier(long parryModifier) {
		this.parryModifier = parryModifier;
	}

	public long getStrenghtReq() {
		return strenghtReq;
	}

	public void setStrenghtReq(long strenghtReq) {
		this.strenghtReq = strenghtReq;
	}

	public long getStaminaReq() {
		return staminaReq;
	}

	public void setStaminaReq(long staminaReq) {
		this.staminaReq = staminaReq;
	}

	public long getManaReq() {
		return manaReq;
	}

	public void setManaReq(long manaReq) {
		this.manaReq = manaReq;
	}

	public long getAttackReq() {
		return attackReq;
	}

	public void setAttackReq(long attackReq) {
		this.attackReq = attackReq;
	}

	public long getParryReq() {
		return parryReq;
	}

	public void setParryReq(long parryReq) {
		this.parryReq = parryReq;
	}

	public long getRequiredFightExp() {
		return requiredFightExp;
	}

	public void setRequiredFightExp(long requiredFightExp) {
		this.requiredFightExp = requiredFightExp;
	}

	public long getRequiredMagicExp() {
		return requiredMagicExp;
	}

	public void setRequiredMagicExp(long requiredMagicExp) {
		this.requiredMagicExp = requiredMagicExp;
	}

	public long getPrice() {
		return price;
	}

	public void setPrice(long price) {
		this.price = price;
	}

	public int getIceDamage() {
		return iceDamage;
	}

	public void setIceDamage(int iceDamage) {
		this.iceDamage = iceDamage;
	}

	public int getFireDamage() {
		return fireDamage;
	}

	public void setFireDamage(int fireDamage) {
		this.fireDamage = fireDamage;
	}

	public int getEarthDamage() {
		return earthDamage;
	}

	public void setEarthDamage(int earthDamage) {
		this.earthDamage = earthDamage;
	}

	public int getWindDamage() {
		return windDamage;
	}

	public void setWindDamage(int windDamage) {
		this.windDamage = windDamage;
	}

	public int getIceDefence() {
		return iceDefence;
	}

	public void setIceDefence(int iceDefence) {
		this.iceDefence = iceDefence;
	}

	public int getFireDefence() {
		return fireDefence;
	}

	public void setFireDefence(int fireDefence) {
		this.fireDefence = fireDefence;
	}

	public int getEarthDefence() {
		return earthDefence;
	}

	public void setEarthDefence(int earthDefence) {
		this.earthDefence = earthDefence;
	}

	public int getWindDefence() {
		return windDefence;
	}

	public void setWindDefence(int windDefence) {
		this.windDefence = windDefence;
	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public long[] getRequiresToLearn() {
		return requiresToLearn;
	}

	public void setRequiresToLearn(long[] requiresToLearn) {
		this.requiresToLearn = requiresToLearn;
	}

	public int getPremiumPrice() {
		return premiumPrice;
	}

	public void setPremiumPrice(int premiumPrice) {
		this.premiumPrice = premiumPrice;
	}

	public long[] getBlocksLearning() {
		return blocksLearning;
	}

	public void setBlocksLearning(long[] blocksLearning) {
		this.blocksLearning = blocksLearning;
	}

	public long getSpeedModifier() {
		return speedModifier;
	}

	public void setSpeedModifier(long speedModifier) {
		this.speedModifier = speedModifier;
	}

	public double getSpeedFactor() {
		return speedFactor;
	}

	public void setSpeedFactor(double speedFactor) {
		this.speedFactor = speedFactor;
	}
	
	@Override
	public String toString() {
		return "Id="+id+", name="+name;
	}

}
